<%--
Created by IntelliJ IDEA.
User: kwc13
Date: 2023-12-6
Time: 上午 08:09
To change this template use File | Settings | File Templates.
--%>
<!-- 标记为HTML格式 -->
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<!-- 设置页面为Chain -->
<html lang="ch">
<head>
    <title>小米商城后台管理</title>
    <!-- 设置地址栏主题背景颜色 -->
    <meta name="theme-color" content="#000000">
    <!-- 页面描述 -->
    <meta name="description" content="页面描述信息">
    <!-- 移动端显示 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!-- 页面Logo -->
    <link rel="shortcut icon" href="http://localhost:8083/resource_packs/images/logo.png">
    <!-- JS -->
    <script src="${pageContext.request.contextPath}/other/component/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/other/resource/input_util.js"></script>
    <script src="${pageContext.request.contextPath}/other/request/background/administrator.js"></script>
    <script src="${pageContext.request.contextPath}/other/resource/text_util.js"></script>
    <script src="${pageContext.request.contextPath}/other/scripts/background/home.js"></script>
    <!-- CSS -->
    <link href="${pageContext.request.contextPath}/other/style/background/home.css" rel="stylesheet"
          type="text/css"/>

</head>
<body>
<%--//完成网页标签功能 名言 日历或增加正在运货和待补货商品--%>
<div class="body">
    <div class="home">
        <div class="login-img">
            <img src="http://localhost:8083/resource_packs/images/logo.png" alt="小米Logo" class="logo">
            <span>
                <a class="title">后台管理页面</a>
                <a class="log-out">
                    <img src="http://localhost:8083/resource_packs/images/log_out.png" alt="退出登陆"/>
                    退出登陆
                </a>
            </span>
        </div>
        <div class="option-content">
            <div class="title-left">
                <jsp:useBean id="administrator" scope="request" type="com.xm.entity.AdministratorInformation"/>
                <div class="list">
                    <div class="menu">
                        <jsp:useBean id="menuList" scope="request" type="java.util.ArrayList"/>
                        <jsp:useBean id="permissionsArray" scope="request" type="java.lang.String[]"/>
                        <c:if test="${fn:length(permissionsArray) != 0}">
                            <c:forEach var="menu" items="${menuList}">
                                <c:forEach var="permissions" items="${permissionsArray}">
                                    <c:if test="${menu.requiredPermissions == permissions}">
                                        <a href="${pageContext.request.contextPath}/background/home?menuId=${menu.menuId}"
                                           class="menu-button" >
                                            <span>${menu.menuName}</span>
                                        </a>
                                    </c:if>
                                </c:forEach>
                            </c:forEach>
                        </c:if>
                        <jsp:useBean id="permissions" scope="request" type="java.lang.String"/>
                        <c:if test="${permissions == 'all'}">
                            <c:forEach var="menu" items="${menuList}">
                                <a href="${pageContext.request.contextPath}/background/home?menuId=${menu.menuId}" class="menu-button">
                                    <span>${menu.menuName}</span>
                                </a>
                            </c:forEach>
                        </c:if>
                    </div>
                </div>
            </div>
            <div class="correspond-content">
                <jsp:useBean id="menuId" scope="request" type="java.lang.Integer"/>
                <c:forEach var="menu" items="${menuList}" varStatus="menuSize">
                    <c:if test="${menuId==menu.menuId}">
                        <!-- 页面 -->
                        <jsp:include page="/WEB-INF/page/background/${menu.pageUrl}" flush="true">
                            <jsp:param name="administrator" value="${administrator}"/>
                            <jsp:param name="permissions" value="${permissions}"/>
                        </jsp:include>
                    </c:if>
                </c:forEach>
            </div>
        </div>
    </div>
    <div class="saying">
        <span></span>
    </div>
</div>
</body>
</html>
